
cc.Class({
    extends: cc.Component,

    properties: {
        delayEdit : cc.EditBox,
        timeEdit :cc.EditBox,
        toggle : require('UI-Toggle')
    },

    showSelect(p,cb,close=false){
        this.node.getChildByName('panel').active =true;
        this.node.getChildByName('editor').active =false;

        this.cb = cb
        var p1 = this.node.convertToNodeSpaceAR(p)
        var panel = this.node.getChildByName('panel');
        panel.x = p1.x;
        panel.y = p1.y-100;
        this.autoClose = close
    },
    onClickClose(){
        if(this.autoClose){
            this.node.active = false;
        }
    },
    showEditor(shun){
        this.node.getChildByName('panel').active =false;
        this.node.getChildByName('editor').active =true;
        this.toggle.setToggle(shun?0:1);
    },
    onClockLine(){
        cc.log('onClockLine')
        this.cb(0,this.timeEdit.string,this.delayEdit.string)
    },
    onClickCircle(){
        cc.log('onClickCircle')
        this.cb(1,this.timeEdit.string,this.delayEdit.string)
    },
    onClickDelete(){
        this.cb(2)
        cc.log('onClickDelete')
    }
});
